package com.EC_Jeans.background.service.login;

import java.util.List;

import com.EC_Jeans.dao.DAO;
import com.EC_Jeans.datamodel.User;
import com.EC_Jeans.datamodel.UserInfo;

public class LoginServiceImpl implements LoginService {

	private DAO dao;
	
	public DAO getDao() {
		return dao;
	}

	public void setDao(DAO dao) {
		this.dao = dao;
	}

	@SuppressWarnings("unchecked")
	public List<User> getUserList() {
		return (List<User>)(dao.get("from User"));
	}

	public void delUser(int userId) {
		User user = (User)dao.get(User.class, userId);
		dao.delete(user);
	}

	public UserInfo getUserInfo(int userId) {
		return (UserInfo)dao.get(UserInfo.class, userId);
	}

}
